#ifndef _RTC_TIME_H_
#define	_RTC_TIME_H_

#include "stdint.h"

#ifdef   _RTC_TIME_MODULE_
#define  TIME_EXT
#else
#define  TIME_EXT  extern
#endif      
    
    typedef struct {
        uint8_t Sec; 		/*!< Seconds Register */
        uint8_t Min; 		/*!< Minutes Register */
        uint8_t Hour; 		/*!< Hours Register */
		uint8_t Week;       /*!< Week Register */
        uint8_t Day;		/*!< Day of Month Register */
        uint8_t Mon; 	    /*!< Months Register */
        uint16_t Year; 		/*!< Years Register */
    } TIME_Type;


    TIME_EXT TIME_Type TimeCur;
    TIME_EXT TIME_Type TimeStart;  //order time for start
    TIME_EXT TIME_Type TimeStop;   //order time for stop
    TIME_EXT uint16_t CenturyCur;
    
    TIME_EXT uint8_t RtcTimeSecLast;
    TIME_EXT uint8_t bRtcPulse_1s;
    
    void TimeRun(void);
    void TimeSet(TIME_Type *pTime);
    void TimeGet(TIME_Type *pTime);
    int8_t TimeCompare(TIME_Type *pTime1,TIME_Type *pTime2);
    void TimeCopy(TIME_Type *pTimeSrc,TIME_Type *pTimeDes);
    void RtcTimePulseCreat(void);
    
#undef TIME_EXT

#endif	/* _RTC_TIME_H_ */

